package com.hospital.data.simulation.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hospital.common.pojo.TDiagnosisRecord;
import com.hospital.data.simulation.exception.DiagnosisRecordServiceException;
import com.hospital.data.simulation.exception.enums.DiagnosisRecordServiceExpCode;
import com.hospital.data.simulation.mapper.TDiagnosisRecordMapper;
import com.hospital.data.simulation.service.TDiagnosisRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class TDiagnosisRecordServiceImpl extends ServiceImpl<TDiagnosisRecordMapper, TDiagnosisRecord> implements TDiagnosisRecordService{
    @Autowired
    private TDiagnosisRecordMapper diagnosisRecordMapper;
    @Override
    public Long addTDiagnosisRecord(TDiagnosisRecord diagnosisRecord) {
        return 1L;
    }

    @Override
    public void updateTDiagnosisRecord(TDiagnosisRecord diagnosisRecord) {
        if(diagnosisRecordMapper.updateById(diagnosisRecord) ==0){
            throw new DiagnosisRecordServiceException(DiagnosisRecordServiceExpCode.UPDATE_DIAGNOSIS_RECORD_FAILED);
        }
    }
}
